/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.jSkyRoom.filter;

import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedList;

/**
 *
 * @author Rakev
 */
public class FilterChainBuilder<E> {

    private Collection<Filter<E>> filtres = new LinkedList<>();

    public FilterChainBuilder() {
    }

    public FilterChain build() {
        return new FilterChain<>(filtres);
    }
    
    public FilterChainBuilder add(Filter<E>... filters){
        return add(Arrays.asList(filters));
    }

    public FilterChainBuilder add(Iterable<Filter<E>> filtres) {
        for (Filter<E> filter : filtres) {
            add(filter);
        }
        return this;
    }

    public FilterChainBuilder add(Filter<E> filter) {
        filtres.add(filter);
        return this;
    }
}
